public class test02 {
    public boolean canConstruct(String ransomNote, String magazine) {
        int[] array = new int[128];
        for(int i =0;i<ransomNote.length();i++){
            array[ransomNote.charAt(i)]++;
        }
        for(int i =0;i<magazine.length();i++){
            array[magazine.charAt(i)]--;
        }
        for(int count:array){
            if(count>0){
                return false;
            }
        }
        return true;
    }
}
